import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'

// 引入Font Awesome核心
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

// 引入需要使用的实心图标
import { 
  faUser, 
  faLock, 
  faMobileAlt, 
  faChevronLeft,
  faChevronRight,
  faChevronDown,
  faEye, 
  faEyeSlash,
  faSeedling,
  faEnvelope,
  // 首页需要的图标
  faHeart,
  faBirthdayCake,
  faDove,
  faGraduationCap,
  faHandsHelping,
  faHome,
  faGift,
  faAngleRight,
  faThLarge,
  faShoppingCart,
  faPhone,
  // 搜索图标
  faSearch,
  // 分页图标
  faAngleLeft,
  // 地图图标
  faMapMarkerAlt,
  // 商品详情页图标
  faStar,
  faStarHalfAlt,
  faShieldAlt,
  faTruck,
  faSyncAlt,
  // 购物车图标
  faTrash,
  // 用户中心图标
  faUserCircle,
  faClipboardList,
  faCommentAlt,
  faCog,
  faSignOutAlt,
  // 订单结算页图标
  faPlus,
  faEdit,
  faCreditCard,
  // 订单详情页图标
  faBox,
  faFlagCheckered
} from '@fortawesome/free-solid-svg-icons'

// 引入需要使用的品牌图标
import { 
  faWeixin, 
  faWeibo 
} from '@fortawesome/free-brands-svg-icons'

// 引入需要使用的常规图标
import {
  faUser as farUser,
  faHeart as farHeart
} from '@fortawesome/free-regular-svg-icons'

// 添加图标到库中
library.add(
  // 实心图标
  faUser, faLock, faMobileAlt, faChevronLeft, faChevronRight, faChevronDown,
  faEye, faEyeSlash, faSeedling, faEnvelope,
  // 首页需要的图标
  faHeart, faBirthdayCake, faDove, faGraduationCap,
  faHandsHelping, faGift, faAngleRight,
  faThLarge, faShoppingCart, faPhone,
  // 搜索图标
  faSearch,
  // 分页图标
  faAngleLeft,
  // 地图图标
  faMapMarkerAlt,
  // 商品详情页图标
  faStar, faStarHalfAlt, faShieldAlt, faTruck, faSyncAlt,
  // 购物车图标
  faTrash,
  // 用户中心图标
  faUserCircle, faClipboardList, faCommentAlt, faCog, faSignOutAlt,
  // 订单结算页图标
  faPlus, faEdit, faCreditCard,
  // 订单详情页图标
  faBox, faFlagCheckered,
  // 底部导航图标
  faHome,
  // 品牌图标
  faWeixin, faWeibo,
  // 常规图标
  farUser, farHeart
)

const app = createApp(App)

// 注册全局组件
app.component('font-awesome-icon', FontAwesomeIcon)

app.use(createPinia())
app.use(router)

app.mount('#app')
